﻿@model List<KPIS.GERP.FileImportToDb.Models.VM1>

@{
    ViewBag.Title = "Index";
        var i = 0;
        int tempRowIndex = 0;
}

<h2>Import  MasContact</h2>
 
<table border="1" width="100%"> 
    @foreach (KPIS.GERP.FileImportToDb.Models.VM1 vm1 in Model.Where(o=>o.IsFullNameEqual && !o.IsBankSame))
    {
        <tr >
            <td>
                @if (tempRowIndex != vm1.Beneficiary.RowIndex)
                {
                    @(++i);
                }
                
                @{

                    tempRowIndex = vm1.Beneficiary.RowIndex;
                }
                    
            </td>
            <td>
                @vm1.Beneficiary.RowIndex
            </td>
            <td>
                @vm1.Beneficiary.fullname
            </td>
            <td>
                @vm1.Beneficiary.account
            </td>
            <td>
                @vm1.Beneficiary.bank_Code
            </td>
            <td>
                @vm1.Beneficiary.bank_Name
            </td>
            <td>
                @vm1.Beneficiary.branch_code
            </td>

            <td>
                @Html.DisplayFor(model => vm1.MasContact.NameTh)
            </td> 
            <td>
                @Html.DisplayFor(model => vm1.MasContact.ConId)
            </td> 
            <td>
                @Html.DisplayFor(model => vm1.MasContactBank.ConId)
            </td>
            <td>
                @Html.DisplayFor(model => vm1.MasContactBank.ConBankId)
            </td>
            <td>
                @Html.DisplayFor(model => vm1.MasContactBank.AccountCode)
            </td>
            <td>
                @Html.DisplayFor(model => vm1.MasContactBank.AccountName)
            </td>
            <td>
                @Html.DisplayFor(model => vm1.MasContactBank.MasBankBranch.Code)
            </td>
            <td>
                @Html.DisplayFor(model => vm1.MasContactBank.MasBankBranch.BranchName)
            </td>
</tr>
    }

</table>